//-------------Sonic CD R2 1 A CycPal Setup Script---------------//
//---------------------Scripted By Twanvanb1---------------------//

// Aliases
#alias Object.Value0	:	Object.Timer
#alias Object.Value1	:	Object.CurrentPalette

// Priority
#alias 1	:	PRIORITY_ACTIVE


sub ObjectMain
	Object.Timer++
	if Object.Timer > 5
		Object.Timer = 0
#platform: SW_Rendering
		RotatePalette(181, 183, 0)
		RotatePalette(184, 186, 0)
#endplatform

#platform: HW_Rendering
		Object.CurrentPalette++
		Object.CurrentPalette %= 3
		SetActivePalette(Object.CurrentPalette, 0, 240)
#endplatform
	end if
end sub

sub ObjectStartup
	Object[19].Type = TypeName[PaletteAnimation]
	Object[19].Priority = PRIORITY_ACTIVE

#platform: HW_Rendering
	TempValue0 = 1
	while TempValue0 < 3
		RotatePalette(181, 183, 0)
		RotatePalette(184, 186, 0)
		CopyPalette(0, TempValue0)
		TempValue0++
	loop
	RotatePalette(181, 183, 0)
	RotatePalette(184, 186, 0)
#endplatform

end sub
